package me.flyray.crm.core.api;

import java.util.HashMap;
import java.util.Map;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.wxiaoqi.security.biz.common.crm.request.PlatformSafetyConfigRequest;
import com.github.wxiaoqi.security.biz.common.msg.BizResponseCode;

import io.swagger.annotations.Api;
import me.flyray.crm.core.biz.PlatformSafetyConfigBiz;
import me.flyray.crm.core.entity.PlatformSafetyConfig;

@Api(tags="平台基础信息管理")
@Controller
@RequestMapping("platformBase")
public class PlatformController {
	
	@Autowired
	private PlatformSafetyConfigBiz platformSafetyConfigBiz;
	
	
	@RequestMapping(value = "/queryPlatformSafetyInfo", method = RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> queryPlatformSafetyInfo(@RequestBody @Valid PlatformSafetyConfigRequest platformSafetyConfigRequest) throws Exception {
		Map<String, Object> respMap = new HashMap<>();
		PlatformSafetyConfig reqSafetyConfig = new PlatformSafetyConfig();
		reqSafetyConfig.setPlatformId(platformSafetyConfigRequest.getPlatformId());
		PlatformSafetyConfig respSafetyConfig = platformSafetyConfigBiz.selectOne(reqSafetyConfig);
		respMap.put("platformSafetyConfig", respSafetyConfig);
		respMap.put("code", BizResponseCode.OK.getCode());
		respMap.put("msg", BizResponseCode.OK.getMessage());
		return respMap;
	}
	

}
